{% extends "index.html" %}
{% block main %}
{% for shareInvite in shareInvites %}
<div class="infoBar"><a href="/shareInvite?key={{ shareInvite.inviteKey }}">You have been invited to be {{ shareInvite.roleNamePhrase }} on '{{ shareInvite.adventure.title }}' by {{ shareInvite.owner.nickname }}</a></div>
{% endfor %}

<div class="books">
	<span class="book"><div>
		<center>
			<a href="/createStory"><span class="newstory">Create A New Story</span></a><br>
			<hr><img src="/stylesheets/bookCover{{ coverImages|random }}.png"><hr>
		</center>
		<code>The StoryForge awaits =)</code><hr>
		<table><tr>
		<td class="myStoryButtonDisabled"><div class="icon-editD"></div>Edit Title &amp; Description</td>
		<td class="myStoryButtonDisabled"><div class="icon-storyEditD"></div>StoryForge</td>
		<td class="myStoryButtonDisabled"><div class="icon-shareD"></div>Share</td>
		<td class="myStoryButtonDisabled"><div class="icon-submitD"></div>Submit For Approval</td>
		</tr></table>
	</div></span>
{% for share in shares %}
	<span class="book"><div>
		<center>
			<b><a href="/playStory?myAdventureKey={{ share.adventure.key }}">{{ share.adventure.title|escape }}</a></b><br>
			<i>{{ share.adventure.author|escape }}</i><br>
			{{ share.adventure.created.date }} ({{ share.roleName }})<hr>
			{% if share.adventure.coverImage %}<img src="/images/{{ share.adventure.coverImage }}.png"><hr>{% endif %}
		</center>
		<code>{{ share.adventure.desc|truncatewords:"30"|escape }}</code><hr>
		<table><tr>

		{% if share.isAdmin %}
			<td class="myStoryButton"><a href="/createStory?myAdventureKey={{ share.adventure.key }}"><div class="icon-edit"></div>Edit Title &amp; Description</a></td>
		{% else %}
			<td class="myStoryButtonDisabled"><div class="icon-editD"></div>Edit Title &amp; Description</td>
		{% endif %}

		{% if share.isAuthor %}
			<td class="myStoryButton"><a href="/storyEditor?myAdventureKey={{ share.adventure.key }}"><div class="icon-storyEdit"></div>StoryForge</a></td>
		{% else %}
			<td class="myStoryButtonDisabled"><div class="icon-storyEditD"></div>StoryForge</td>
		{% endif %}

		{% if share.isAdmin %}
			<td class="myStoryButton"><a href="/share?myAdventureKey={{ share.adventure.key }}"><div class="icon-share"></div>Share</a></td>
		{% else %}
			<td class="myStoryButtonDisabled"><div class="icon-shareD"></div>Share</td>
		{% endif %}

		{% if share.isReader %}
			<td class="myStoryButton"><a href="/submit?myAdventureKey={{ share.adventure.key }}"><div class="icon-submit"></div>Submit For Approval</a></td>
		{% else %}
			<td class="myStoryButtonDisabled"><div class="icon-submitD"></div>Submit For Approval</td>
		{% endif %}

		</tr></table>
	</div></span>
{% endfor %}
</div>

{% if iphoneLinks %}
<div class="book3">
	iPhones linked to your account:<ul>
	{% for iphoneLink in iphoneLinks %}
		<li>{{ iphoneLink.iphoneId|escape }}
	{% endfor %}
	</ul>
</div>
{% endif %}
{% endblock %}



{% block index %}
{% endblock %}
